package com.example.redis.demo.response;

public class UserInfoUpdateResponse extends BaseResponse {

    public UserInfoUpdateResponse(String code, String message, UserInfoResult data) {
        super(code, message);
        this.data = data;
    }

    public UserInfoUpdateResponse(String code, String message) {
        super(code, message);
    }


    private UserInfoResult data;

    public UserInfoResult getData() {
        return data;
    }

    public void setData(UserInfoResult data) {
        this.data = data;
    }

    public static class UserInfoResult {

        private String email;

        public UserInfoResult(String email) {
            this.email = email;
        }

        public String getEmail() {
            return email;
        }

        public void setEmail(String email) {
            this.email = email;
        }
    }

    public static UserInfoUpdateResponse success(Object data) {
        UserInfoUpdateResponse baseResponse = new UserInfoUpdateResponse("200", "success");
        baseResponse.setData(new UserInfoResult(data.toString()));
        return baseResponse;
    }
}
